<form onsubmit="return false;" action="{:request()->url()}" data-auto="true" method="post" class='layui-form layui-card' autocomplete="off">

    <div class="layui-card-body">
		<div class="layui-form-item">
            <label class="layui-form-label label-required-prev">公司名</label>
            <div class="layui-input-block">                     
                <select class="layui-select" name="customer_id" lay-search required lay-filter="customer_id">
	            	<option value="">请选择公司名</option>
	                {foreach $customers as $k=>$v}              
	                <option value="{$v.id}">{$v.name}</option>
	                {/foreach}
	            </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label label-required-prev">联系人姓名</label>
            <div class="layui-input-block">                     
                <input name="link_name"  required value='' placeholder="请输入联系人姓名" class="layui-input">                                          
            </div>
        </div>
        
        <div class="layui-form-item">
            <label class="layui-form-label label-required-prev">是否成交</label>
            <div class="layui-input-block">
            <select class="layui-select" name="transaction" lay-search required >
            	<option value="">请选择是否成交</option>
                {foreach $transactions as $k=>$v}              
                <option value="{$k}">{$v}</option>
                {/foreach}
            </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label label-required-prev">跟进时间</label>
            <div class="layui-input-block">                     
                <input data-date-input="" name="follow_at" value="" required
                            placeholder="请选择跟进时间" 
                            class="layui-input" autocomplete="off">                                          
            </div>
        </div>
        
        <div class="layui-form-item">
            <label class="layui-form-label">跟进内容</label>
            <div class="layui-input-block">
                <textarea class="layui-textarea"  name="content" ></textarea>
            </div>
        </div>


    </div>

    <div class="hr-line-dashed"></div>
    
    <div class="layui-form-item text-center">
        <button class="layui-btn" type='submit'>保存</button>
        <button class="layui-btn layui-btn-danger" type='button'  data-close>取消</button>
    </div>
    <script>window.form.render();</script>
</form>
<script>
        window.form.render();
        form.on('select(customer_id)', function(data){
            if(data.value){
                $.form.load('{:url("link_name")}', {customer_id : data.value}, "post", function (ret) {
                    if (ret.code === 1) {
                        var data = ret.data;
                        $("[name='link_name']").val(data);
                       
                    } else {
                        $.msg.auto(ret.info, 1)
                        $("[name='link_name']").val("");
                    }
                    form.render()
                    return false;
                })
            }else{
                $("[name='link_name']").val("");
            }
            
            form.render()
         });
         require(['ckeditor', 'angular'], function () {
	        window.createEditor('[name="content"]', {height: 450});
	        var app = angular.module("GoodsForm", []).run(callback);
	        angular.bootstrap(document.getElementById(app.name), [app.name]);  
	      
	    })
         
    </script>
<style>
     .layui-form-selected dl{
        max-height: 780px;
    }
    .layui-card-body{
        height: 780px;
    }
</style>